﻿using System;
using System.Collections.Generic;
using System.Text;
using DataAccess;
using System.Data;
using Entity;

namespace BusinessObject
{
    public class CustomerBO
    {
        CustomerDA cDA = new CustomerDA();

        public DataSet getCustomer()
        {
            DataSet dt = cDA.getCustomer();
            return dt;
        }

        public bool createCustomer(string name, string phone, string email)
        {
            Customer c = new Customer();
            c.CustomerName = name;
            c.CustomerPhone = phone;
            c.CustomerEmail = email;
            if (cDA.CreateCustomer(c))
            {
                return true;
            }
            return false;
        }

        public Customer selectCustomerById(int id)
        {
            Customer c = cDA.getCustomerById(id);
            return c;
        }

        public bool updateCustomer(Customer c)
        {
            if (cDA.UpdateCustomer(c))
            {
                return true;
            }
            return false;
        }

        public bool removeCustomer(Customer c)
        {
            if (cDA.DeleteCustomer(c))
            {
                return true;
            }
            return false;
        }

    }
}
